package com.mss.media.controller;


import com.mss.media.dto.AuditProfessionalDTO;
import com.mss.media.dto.PageDTO;
import com.mss.media.service.IProfessionalAuditListService;
import com.mss.media.util.ResultBody;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 用户职业审核列表  前端控制器
 * </p>
 *
 * @author runqiang
 * @since 2021-12-01
 */
@RestController
@CrossOrigin
@RequestMapping("/professional-audit-list")
public class ProfessionalAuditListController {

    @Autowired
    private IProfessionalAuditListService professionalAuditListService;

    /**
     * 查询职业审核列表
     *
     * @param dto 分页信息
     * @return 分页数据
     */
    @RequiresPermissions("admin:professional-audit-list-find-page")
    @PostMapping("/find-page")
    public ResultBody findProfessionalAuditPage(@RequestBody PageDTO dto) {
        return ResultBody.success(professionalAuditListService.findProfessionalAuditPage(dto));
    }
    /**
     * 审核职业申请
     *
     * @param dto 审核信息
     * @param request 请求头
     * @return 状态
     */
    @RequiresPermissions("admin:institutions-audit-list-audit")
    @PostMapping("/audit")
    public ResultBody auditInstitutions(@RequestBody AuditProfessionalDTO dto, HttpServletRequest request) {
        return ResultBody.success(professionalAuditListService.auditProfessional(dto,request));
    }
}
